Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt the reporting to the rendering of dashboards #6558

Merged
merged 54 commits into from May 16, 2024

Conversation

Desvelao
Copy link
Member

@Desvelao Desvelao commented Mar 27, 2024

Description

This pull request adapts the reporting to the rendering of dashboards.

Changes:

  • Adapt the Generate report button to use the search context
    • Create state and reducers into Redux store
    • Create hook to send the search context from a dashboard
      to the Generate report button
    • Remove disabledReport property and use the search context instead
    • Replace the mechanim to take the visualizations of the screenshots from the DOM
    • Remove the dependency injection of the unused AngularJS service to
      generate the reports
    • Adapt the report of agent inventory to use the data source
  • Add abilities to the toast message when a PDF report is generated:
    • Open the report
    • Go to the Reporting application
  • Remove unused AngularJS service to generate the reports
  • Fix an error creating the image from map visualizations
  • Fix an error about malformed row related to summary alerts tables
  • Fix the query on GitHub > Dashboard did not take into account the date range filter
  • Fix missing Generate report button on Office 365 > Dashboard
  • Add support to Office 365 for agents according to the documentation
  • Fix missing Generate report button on Inventory data

Warning

This pull request depends on the implementations of dashboards #6477.

Issues Resolved

#6556
#6457

Evidence

Report toast
image

Test

Legend:
⚫: none
🟒: pass
🟑: warning
πŸ”΄: fail
βšͺ: not applicable

UI

Test Chrome Firefox Safari
Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser. ⚫ ⚫ ⚫
Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one. ⚫ ⚫ ⚫
Go to the Server management > Endpoints Summary, select an agent, then go to Invenotyr data and click on the Generate report button. Verify the data included in the report it is the expected one. ⚫ ⚫ ⚫
Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one. ⚫ ⚫ ⚫

Details

⚫ Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser.

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ Go to the Server management > Endpoints Summary, select an agent, then go to Invenotyr data and click on the Generate report button. Verify the data included in the report it is the expected one.

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

- Adapt the Generate report button to use the search context
  - Create state and reducers into Redux store
  - Create hook to send the search context from a dashboard
    to the Generate report button
  - Remove disabledReport property and use the search context instead
- Replace the mechanim to take the visualizations of the screenshots from the DOM
- Remove the dependency injectiong of the unused AngularJS service to
  generate the reports
…rated

- Add abilities to the toast message when a PDF report is generated:
  - Open the report
  - Go to Reporting application
@Desvelao Desvelao self-assigned this Mar 27, 2024
@Desvelao Desvelao linked an issue Mar 27, 2024 that may be closed by this pull request
6 tasks
Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 28.94% ( 286 / 988 )
Branches 26.22% ( 107 / 408 )
Functions 26.87% ( 86 / 320 )
Lines 28.68% ( 278 / 969 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.15% ( 4212 / 34661 )
Branches 7.8% ( 1776 / 22750 )
Functions 10.76% ( 888 / 8249 )
Lines 12.34% ( 4101 / 33222 )

@Desvelao Desvelao changed the title Adapt the reporting to the redering of dashboards Adapt the reporting to the rendering of dashboards Apr 1, 2024
…o feat/6556-adapt-reporting-dashboard-rendering
…o feat/6556-adapt-reporting-dashboard-rendering
…o feat/6556-adapt-reporting-dashboard-rendering
…o feat/6556-adapt-reporting-dashboard-rendering
…o feat/6556-adapt-reporting-dashboard-rendering
…o feat/6556-adapt-reporting-dashboard-rendering
…o feat/6556-adapt-reporting-dashboard-rendering
@Desvelao Desvelao marked this pull request as ready for review May 15, 2024 10:40
@asteriscos asteriscos self-requested a review May 15, 2024 14:25
@asteriscos
Copy link
Member

asteriscos commented May 15, 2024

Test Chrome Firefox
Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser. ⚫ ⚫
Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one. 🟒 🟒
Go to the Server management > Endpoints Summary, select an agent, then go to Inventory data and click on the Generate report button. Verify the data included in the report it is the expected one. πŸ”΄ πŸ”΄
Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one. 🟒 🟒

Details

⚫ Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser.

Chrome - ⚫

Firefox - ⚫

🟒 Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - 🟒

image

wazuh-agent-configuration-001-1715789864.pdf

Firefox - 🟒

image

wazuh-agent-configuration-002-1715790008.pdf

πŸ”΄ Go to the Server management > Endpoints Summary, select an agent, then go to Inventory data and click on the Generate report button. Verify the data included in the report it is the expected one.

Chrome - πŸ”΄

The button the generate the report no longer exists
image

Firefox - πŸ”΄

The button the generate the report no longer exists
image

🟒 Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - 🟒

image

image

Firefox - 🟒

image

image

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@Desvelao
Copy link
Member Author

I was reviewing the missing button to generate report on Inventory data and this seems was removed when we refactored the AngularJS template related to agents on aee0268#diff-f2709f07ddcbc36d539eeca4fa1d4c2ff3baa5dd1cf302633d6ae2270630c632L31-L34.

I will talk with @lucianogorza about the context of removing the component that rendered the button and other things.

@asteriscos
Copy link
Member

I was reviewing the missing button to generate report on Inventory data and this seems was removed when we refactored the AngularJS template related to agents on aee0268#diff-f2709f07ddcbc36d539eeca4fa1d4c2ff3baa5dd1cf302633d6ae2270630c632L31-L34.

I will talk with @lucianogorza about the context of removing the component that rendered the button and other things.

We will fix this in the next stage of the release.

@asteriscos
Copy link
Member

asteriscos commented May 16, 2024

Test Chrome Firefox
Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser. 🟒 🟒
Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one. 🟒 🟒
Go to the Server management > Endpoints Summary, select an agent, then go to Inventory data and click on the Generate report button. Verify the data included in the report it is the expected one. 🟒 🟒
Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one. 🟒 🟒

Details

🟒 Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser.

Malware detection

Overview
wazuh-module-overview-pm-1715872208.pdf

Agent
wazuh-module-agents-001-pm-1715872297.pdf

FIM

Overview
wazuh-module-overview-fim-1715872364.pdf

Agent
wazuh-module-agents-001-fim-1715872322.pdf

Threat hunting

Overview
wazuh-module-overview-general-1715872395.pdf

Agent
wazuh-module-agents-002-general-1715872463.pdf

Mitre att&ck

Overview
wazuh-module-overview-mitre-1715874861.pdf

Agent
wazuh-module-agents-002-mitre-1715873688.pdf

Virus total

Overview
wazuh-module-overview-virustotal-1715873748.pdf

Agent
wazuh-module-agents-002-virustotal-1715873715.pdf

PCI DSS

Overview
wazuh-module-overview-pci-1715873775.pdf

Agent
wazuh-module-agents-002-pci-1715873813.pdf

GDPR

Overview
wazuh-module-overview-gdpr-1715873857.pdf

Agent
wazuh-module-agents-002-gdpr-1715873835.pdf

HIPAA

Overview
wazuh-module-overview-hipaa-1715873892.pdf

Agent
wazuh-module-agents-002-hipaa-1715873924.pdf

NIST 800-53

Overview
wazuh-module-overview-nist-1715873988.pdf

Agent
wazuh-module-agents-002-nist-1715873955.pdf

TSC

Overview
wazuh-module-overview-tsc-1715874034.pdf

Agent
wazuh-module-agents-002-tsc-1715874403.pdf

Docker

Overview
wazuh-module-overview-docker-1715874460.pdf

Agent
wazuh-module-agents-002-docker-1715874432.pdf

AWS

Overview
wazuh-module-overview-aws-1715874501.pdf

Agent
wazuh-module-agents-002-aws-1715874541.pdf

Google cloud

Overview
wazuh-module-overview-gcp-1715874629.pdf

Agent
wazuh-module-agents-002-gcp-1715874568.pdf

Github

Overview
wazuh-module-overview-github-1715874654.pdf

Agent
wazuh-module-agents-001-github-1715874694.pdf

Office 365

Overview
wazuh-module-overview-office-1715874729.pdf

🟒 Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - 🟒

wazuh-agent-configuration-002-1715857506.pdf

Firefox - 🟒

wazuh-agent-configuration-001-1715857578.pdf

🟒 Go to the Server management > Endpoints Summary, select an agent, then go to Inventory data and click on the Generate report button. Verify the data included in the report it is the expected one.

Chrome 🟒
wazuh-agent-inventory-001-1715872028.pdf

Firefox 🟒
wazuh-agent-inventory-002-1715872114.pdf

🟒 Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - 🟒

image

Firefox - 🟒

image

…o feat/6556-adapt-reporting-dashboard-rendering
@JuanGarriuz JuanGarriuz self-requested a review May 16, 2024 13:14
- Add missing Generate report button on Inventory data
  - Add header with agent name link to Inventory data, Stats and
    Configuration from agent view
- Simplify the styles of panels on Inventory data
  - Remove unwanted styles defined on file
@JuanGarriuz
Copy link
Member

Test

Legend:
⚫: none
🟒: pass
🟑: warning
πŸ”΄: fail
βšͺ: not applicable

UI

Test Chrome Firefox Safari
Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser. ⚫ ⚫ ⚫
Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one. 🟒 ⚫ ⚫
Go to the Server management > Endpoints Summary, select an agent, then go to Invenotyr data and click on the Generate report button. Verify the data included in the report it is the expected one. 🟒 ⚫ ⚫
Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one. 🟒 ⚫ ⚫

Details

⚫ Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser.

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

🟒 Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - 🟒

image

Firefox - ⚫

Safari - ⚫

🟒 Go to the Server management > Endpoints Summary, select an agent, then go to Invenotyr data and click on the Generate report button. Verify the data included in the report it is the expected one.

Chrome - 🟒

image

image

Firefox - ⚫

Safari - ⚫

🟒 Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - 🟒

image
image

Firefox - ⚫

Safari - ⚫

asteriscos
asteriscos previously approved these changes May 16, 2024
@asteriscos asteriscos merged commit 577a524 into 4.9.0 May 16, 2024
1 check passed
@asteriscos asteriscos deleted the feat/6556-adapt-reporting-dashboard-rendering branch May 16, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants